package com.jeasonzhao.report.engine.irp;

import com.jeasonzhao.commons.logger.Logger;
import com.jeasonzhao.report.dataset.DataSet;
import com.jeasonzhao.report.exceptions.DataSetGenerateException;
import com.jeasonzhao.report.model.Report;

public interface IDataSetProvider
{
    /**
     * Invoked when reportAgent got a request
     * @param report Report Report
     * @throws DataSetGenerateException
     */
    public void setup(Logger log,Report report)
        throws DataSetGenerateException;

    /**
     * @param nPageSize int
     * @param nCurrentPageNo int The start pageNo is 0 rather than 1
     * @return DataSet
     * @throws DataSetGenerateException
     */
    public DataSet getDataSet(Logger log,int nPageSize,int nCurrentPageNo)
        throws DataSetGenerateException;

    /**
     * Invoked after getDataSet
     * @throws ReportException
     */
    public void teardown(Logger log)
        throws DataSetGenerateException;
}
